<?php
if (!defined('ABSPATH'))
    exit;

global $product, $woocommerce_loop;

// Store loop count we're currently on
if (empty($woocommerce_loop['loop']))
    $woocommerce_loop['loop'] = 0;

// Store column count for displaying the grid
if (empty($woocommerce_loop['columns']))
    $woocommerce_loop['columns'] = apply_filters('loop_shop_columns', 4);

// Ensure visibility
if (!$product->is_visible())
    return;

// Increase loop count
$woocommerce_loop['loop']++;

// Extra post classes
$classes = array();
if (0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'])
    $classes[] = 'first';
if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'])
    $classes[] = 'last';
?>
<li <?php post_class($classes); ?>>

    <?php do_action('woocommerce_before_shop_loop_item'); ?>
    <div class="pic_padd wrapper_pic_div">
        <a href="<?php the_permalink(); ?>" class="prods_pic_bg">
            <?php
            do_action('woocommerce_before_shop_loop_item_title');
            ?>
        </a>
    </div>    
    <div class="prods_padd">
        <div class="cont7">
            <div class="name name_padd" style="min-height: 36px;">
                <div>
                    <span>
                        <a href="<?php the_permalink(); ?>">
                            <?php
                            $title = get_the_title();
                            if (strlen($title) > 45) {
                                $title = substr($title, 0, 45) . '...';
                            }
                            echo $title;
                            ?>
                        </a>
                    </span>
                </div>
            </div>
        </div>
    </div>    

    <?php
    do_action('woocommerce_after_shop_loop_item_title');
    ?>
    <?php do_action('woocommerce_after_shop_loop_item'); ?>

</li>